package core.cwm;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import core.obj.Object;
import core.sub.Company;

public class PRObject {
	private List<Object> objects = null;
	
	public boolean add(Object obj) {
		if(objects == null)
			objects = new ArrayList<Object>();
		if(!objects.contains(obj)) {
			objects.add(obj);
			return true;
		}
		return false;
	}
	
	public boolean contains(Object obj) {
		if(objects == null)
			return false;
		if(objects.contains(obj))
			return true;
		return false;
	}
	
	public void remove(Object obj) {
		if(objects != null && obj != null) {
			objects.remove(obj);
		}
	}
	
	public void removeAll(Set<Object> objs) {
		if(objects != null) {
			for(Object obj:objs) {
				objects.remove(obj);
			}
		}
	}
	
	/**
	 * Remove objects belong to C1 and C2
	 * @param C1
	 * @param C2
	 */
	public void remove2(Company C1, Company C2) {
		if(objects != null) {
			
		}
	}
	
	public List<Object> getObjects() {
		return objects;
	}
}
